package com.wuwei.tms.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wuwei.tms.config.BaseDateConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 *
 * </p>
 *
 * @author wuwei
 * @since 2024-01-03
 */
@TableName("t_borrow")
@Data
@ApiModel(value = "TBorrow对象", description = "")
public class Borrow implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @ExcelIgnore
    private Long id;

    @ColumnWidth(20)
    @ExcelProperty(value = {"借用时间"}, converter = BaseDateConverter.LocalDateTimeConverter.class,index = 0)
    private LocalDateTime borrowTime;

    @ColumnWidth(20)
    @ExcelProperty(value = {"归还时间"}, converter = BaseDateConverter.LocalDateTimeConverter.class,index = 1)
    private LocalDateTime returnTime;

    @ExcelProperty(value = "飞机注册号",index = 4)
    private String airplaneId;

    @ExcelProperty(value = "借用人",index = 2)
    @ExcelIgnore
    private Long borrowById;//User的empno

    @ExcelProperty(value = "归还人",index = 3)
    @ExcelIgnore
    private Long returnById;//User的empno

    @ExcelProperty(value = "借用数量",index = 5)
    private Integer borrowCount;//该条记录为借出后的总工具数,此条数据在每次归还操作时不会改变

    @ExcelProperty(value = "归还数量",index = 6)
    private Integer returnCount;//表示此工具之前已经还过的数量,此条数据会随着每次归还增加,直到借出数量等于归还数量

    @ExcelIgnore
    @ApiModelProperty("returnFlag 表示该工具是否有归还过，主要针对消耗品，归还过为1，未全部归还为0")
    private Integer returnFlag;//returnFlag 表示该工具是否有归还过，主要针对消耗品，归还过为1，未全部归还为0，因此，到时候借还历史里有一部分记录在这里面

    @ColumnWidth(13)
    @ExcelProperty(value = "工具编号",index = 7)
    private Long barcode;//t_tool表的barcode

    @ExcelProperty(value = "操作者",index = 8)
    @ApiModelProperty("t_user表的empno")
    private String operatorName;

    @ExcelIgnore
    private Long operator;//User的empno

    @ColumnWidth(20)
    @ExcelProperty(value = "工具名称",index = 9)
    private String toolName;//t_tool表的工具名称

}
